<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			body{
				height: 10000px;
			}
		</style>
		<script>
			alert(window.navigator.appName+">>>>"+window.navigator.appVersion);
			function showWin(){
				/*var w=window.innerHeight;
				var h=window.innerWidth;*/
				var w = document.documentElement.clientWidth ||  document.body.clientWidth;

			  var h = document.documentElement.clientHeight || document.body.clientHeight;

				alert("窗口大小是长："+h+",宽是"+w);
				 
			}
			function gotoTao(){
				window.location="https://www.taobao.com";
			}
			function doPrint(){
				//window.print();
				
				//window.save();
				window.scrollTo(0,9000);
			}
			function closeWin(){
				var r=confirm("真的要关闭吗？");
				if(r){
					alert("真的关闭");
					window.close();
				}else{
					alert("取消关闭");
				}
			}
			function openAd(){
				window.open("https://www.oschina.net","开源中国","fullscreen=yes,height=200px,width=300px,resizable=0,left=100px,top=200px");
			}
			function open2(){
				var p=window.createPopup()
				var pbody=p.document.body
				pbody.style.backgroundColor="lime"
				pbody.style.border="solid black 1px"
				pbody.innerHTML="This is a pop-up! Click outside to close."
				p.show(150,150,200,50,document.body)
			}
		</script>
	</head>
	<body onload="openAd()">
		<input type="button" value="获得窗口大小" onclick="showWin()"/>
		<input type="button" value="切换地址" onclick="gotoTao()"/>
		<input type="button" value="打印" onclick="doPrint()"/>
		<input type="button" value="关闭" onclick="closeWin()" />
		
		<input type="button" value="弹出" onclick="open2()" />
		<hr />
		<a href="win3.html" >去窗口3</a>
	</body>
</html>
